HyperCard Menus

Index

Most stacks you will see come with a standard menu bar. HyperCard users expect to be able to use many of the items in the menus to carry out functions like copying cards, printing and navigation through the stack.

Hiding and Showing the menu bar

Unless it has been deleted in the stack's scripts you can show a hidden menu bar by pressing <Command-M>. The same keyboard combination will also hide a menu bar that is showing.

doMenu

This command can be used in scripts to activate any item in the menu bar

Customising the menu bar

It's very useful to be able to change the menu bar for particular stacks. HyperCard allows many possibilities to:

Change the name of any menu item

Enable or disable any menu or menu item

Add or delete menu items

Create new menus

Copy and paste this script into a new button in a HyperCard stack. The menuMsg defines what each menu item does

( This script is from Dan Shafer's The Complete Book of HyperTalk 2 )

on mouseUp
  if there is a menu "testing" then
    answer "There is already a menu called Testing " with OK
    exit mouseUp
  end if
  create menu "Testing"
  put "Once" after menu "Testing" with menuMsg  "beep 1"
  put "Twice" after menu "Testing" with menuMsg  "beep 2"
  put "Three Times" after menu "Testing" with menuMsg  "beep 3"
  put "Four Times" after menu "Testing" with menuMsg  "beep 4"
end mouseUp

When you click on the button you will see a new menu "Testing" at the end of your menu bar. Try it out.

Delete a menu

Resetting the menu bar

To return to the standard menu bar simply type <reset menuBar>. If you have customised a menu for a particular stack it makes sense to reset the menu when the user closes that stack. Put the following script into your stack script

on closeStack
  reset menuBar
end closeStack

Return to top of page